#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>

bool isAnagram(char* s, char* t) {
	int HashList[26] = { 0 };
	memset(HashList, 0, 1);
	while (*s) {
		HashList[*s - 'a']++;
		s += 1;
	}
	while (*t) {
		HashList[*t - 'a']--;
		t += 1;
	}
	for (int i = 0; i < 26; i++) {
		if (HashList[i] != 0) return false;
	}
	return true;
}

int main()
{
	int num;
	scanf("%d", &num);
	char* s = (char*)malloc(sizeof(int) * num);
	char* t = (char*)malloc(sizeof(int) * num);
	for (int i = 0; i < num; i++) {
		scanf("%c", &s[i]);
	}
	for (int i = 0; i < num; i++) {
		scanf("%c", &t[i]);
	}

	if (isAnagram(s,t)) {
		printf("same\n");
	}
	else {
		printf("diff\n");
	}
	free(s);
	free(t);
	return 0;
}